package org.shopen.ai.puremvc.controller.project
{
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	import org.puremvc.as3.utilities.statemachine.StateMachine;
	import org.shopen.ai.puremvc.ApplicationConstants;
	import org.shopen.ai.puremvc.model.project.ProjectsProxy;

	public class SelectProjectCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void
		{
			var projectId : String = notification.getBody().toString();
			var proxy : ProjectsProxy = facade.retrieveProxy(ProjectsProxy.NAME) as ProjectsProxy;
			proxy.setCurrentProject(projectId);

			sendNotification(StateMachine.ACTION, notification.getBody(), ApplicationConstants.ACTION_SELECT_PROJECT);
		}
	}
}